/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = ora_varchar_accessor.c                             */
/*  NOTE      =                                                    */
/*  DATE      = 2015/01/14 by songbb                               */
/*******************************************************************/

#include "conntrack.h"

#include "../../ora_core.h"
#include "../ora_ttc_proto.h"
#include "ora_marshaller.h"
#include "ora_varchar_accessor.h"

/*******************************************************************************
*  FUNC     :  解析 varchar 类型数据
*  ARGS     :  *p_st_conn                           (ct信息)
*           :  *p_st_sess                           (Oracle私有的session)
*           :  *p_st_ora_packet                     (Oracle数据包)
*           :  *p_st_metadata                       (meta信息)
*  RTN      :  0                                    (FR_SUCC)
*              1                                    (FR_FAIL)
*  NOTE     :
*******************************************************************************/
int ora_varchar_accessor_unmarshal_one_row(Conntrack *p_st_conn
                                        , L7session_ora *p_st_sess
                                        , L7_ora_packet *p_st_ora_packet
                                        , Sql_metadata_info *p_st_metadata)
{
    if (p_st_metadata->i_data_type == ORA_DTY_LONG)
        return ora_marshaller_long_unmarshal_one_row(p_st_conn, p_st_sess, p_st_ora_packet, p_st_metadata);
    else
        return ora_marshaller_varchar_unmarshal_one_row(p_st_conn, p_st_sess, p_st_ora_packet, p_st_metadata);
}
